http://www.bnet.139138.com/a0757/index.php?modules=show&id=1
Ofstar------ textdb :ȶ



.ȫfenyuѧоɹ(ϣǵķƱܸ֮php---texdbµ).

Ҫofstar----textdbʵݵĸ.ȶԵʵ! 
㷨Դ ofstar board http://www.ofstar.net 
ʱ.ûϸĽ.еϸⲻкõĽ.ϵofstar Ŷӹѧ.QQ:280205859 .Ȼڴܲǰ.Ժ󻹻Ч¹.һЩ㷨ϸڿܻ仯!

(һ)ݿģ
ݿһϢļ,ÿ϶һʽͳһļ¼,¼ֶι.ͨϳΪ,¼Ϊе.
ݿһΪƽļݿ(TEXT),λݿ,ݿ,ϵݿ(mysql),ϵݿ!

ϵݿǳԱĽ

ƽļݿ,ֱϵͳϵ,ӦóҪ༭Ϣʱ,ȷֶȷʽ.ʽĽӿڴ۰,ΪҪһֵ3(3GL),Ҫո߶ȼܵԱгʱĿ!Ա뿼ݵ

߼ʾ,Ҫļȡһ,ԱҪ֪дıʽǶʽļӦó֮ʱ,ѭһԼƽļݿĸЧһȡڳԱˮƽ!MYSQLʵݵĶ,Ҳʵ˽ṹĶ!˳Աݹĸ!׿˺ܶݿ⴦ڲϸ!RDBMSҪ!Ҳռ!

ĳ--ϵݿģ

ݿģ,MYSQLһֹϵݿ,ǹϵģͲMYSQLר,ݿ۵ĸڼ,ȽһЩԭҲڹϵģ,Ǿͨ3GLĳԱ,ʹƽļݿⲻԿĳ!ڻݴ,̿,Դ,кܴ! ҪԴݽƵĶд!,ʹöλָȡָ,, νĸ,ӭж,Ҳǳ,λģ͵Ĳԭ!ȻҪĻǳԱ,Ƶ,ùҪ!

ҽҪofstar̳textdb--ƽļݿڸ߸µȶ.textdbİȫӿ.Чʵʵ.ݼ....

( ¸㷨ȶ㷨Ofstar board.ǵͶɹ! )

()textdb߸صǰʵݵĿٴ

(1)textdbͳ: 
йһ.Ĳֱج.Ȳ˵.ݵȶ!Ǽ򵥵ɾԼ޸漰ݲòô󲿷ֵĳԱȴ....ݴԳͻɵݵĲ׼ȷͲȶ.ùûtextdb....
.νԴݽпȶʵɾ.޸ĵһϵݲ!? α֤ڸ߸¶ݽƵʱ.ܱ֤ݵȶ.ͱݵ׼ȷ!!?? 2ϸ

(2)ݸµĿ 
[1]textdbļʶ:
˳ļ.ļ.ؼļ.
ļɰ¼һԷֳɶ¼ļͲ¼ļ! ҪЩļ.ݸ.3GLʹ
[2]˳ļ
Ƕ˳ļ----Ǵͳݴ.Ҳǹѧϰõݴ洢. м¼ļе߼˳ν洢ʶ.

ص:
ȡi¼,֮ǰi-1¼.
µļ¼ʱֻļĩβ.Ҫ˳洢ļ޸
Ҫļеĳ¼.뽫ļи
.ļԽԽʱ.ɾ޸.÷ǳ.

˳ļ-----ݵļ޸.ǣ浽
1)ݽṹB+ԭ..˳.ݼ.˳򼯺һ𹹳һB+.ֱ洢.ָеָ.ؼ! ڲһ޸ʱԲ˳ȡ.ֿɴ߲аؼִȡ.

һ˼뽫3(Գ͵ļ):
1,ҪƵݴļ.ҼƵʴдƵ.˼ʵֲøж˳˼.еŸ
³ofstarİ
ʱֻҪµʹ (require/postnew.php)
$newdb="|||$ofstarid||$tid|0|$threadnew|0||";
$newlist=str_pad($newdb,$db_linesize)."\n";
writeover("$dbpath/$fid/list.php",$newlist,"ab");
޸ɾʱеҹؼִ(require/dbmodify.php):

function readsearch($filename,$tid,$db_linesize)
{
     $size=5000;
     $step=0;$end=0;$readsize=$db_linesize+1;$scharray=array();
     if($fp=@fopen($filename,"rb+")){
           flock($fp,LOCK_EX);
           while(!feof($fp)){
                 $step++;
                 $offset=-$readsize*$step;
                 fseek($fp,$offset,SEEK_END);
                 $line=fread($fp,$readsize);
                 if(strpos($line,"||$tid|")!==false){
                       $detail=explode("|",$line);
                       break;
                 }elseif($step<$size){
                       $scharray[]=$line;
                 }else{
                       $fastwrite='Y'
                 }
           }
           fseek($fp,$offset,SEEK_END);
           return array($fp,array_reverse($scharray),$detail,$fastwrite);
     }
}

ɾʱ㷨ʵ:

function write_del($fp,$writearray,$fastwrite)
{
     global $db_linesize;
     if($fastwrite!="Y"){
           $writedb=implode("",$writearray);
           fputs($fp,$writedb);
           ftruncate($fp,ftell($fp));
     }else{
           fputs($fp,str_pad(' ',$db_linesize)."\n");
     }
}

޸ʱ㷨ʵ:

function write_alt($fp,$writearray,$fastwrite,$inline)
{
     global $db_linesize;
     if($fastwrite!="Y"){
           array_push($writearray,$inline);
           $writedb=implode("",$writearray);
           fputs($fp,$writedb);
     }else{
           fputs($fp,str_pad(' ',$db_linesize)."\n");
           fseek($fp,0,SEEK_END);
           fputs($fp,$inline);
     }
}

㷨ʵ:

$total=$page*$db_perpage;
$linestart=min($total,$statusdetail[7]);
$pernum=$linestart-$total+$db_perpage;
$articleshow=readfrombot($filename,$linestart,$pernum,$db_linesize);
if($page==1){
     $threadtop=gettoparray($filename,$db_linesize);
     $articleshow=array_merge($threadtop,$articleshow);
}
function readfrombot($filename,$linestart,$linenum,$db_linesize)
{
     $offset=max(-($db_linesize+1)*$linestart,-(filesize($filename)-($db_linesize+1)*11));
     $num=0;$readb=array();
     if($fp=fopen($filename,"rb")){
           flock($fp,LOCK_SH);
           fseek($fp,$offset,SEEK_END);
           while(!feof($fp)&&$num<$linenum){
                 $readb[]=fgets($fp,100);
                 $num++;
           }
           fclose($fp);
     }
     return array_reverse($readb);
}

ȫõ. ݵĴֻҪĵ.ȫдȡ!
2,Ƶ޸ĺɾ.ÿжؼ.ݽضԼļ
/*ҵпвɾ֮.ҵһ¼Կ.߻Ա*/

function substrnbsp($filename)
{
     global $db_olsize,$timestamp,$db_onlinetime,$guestinbbs,$userinbbs;
     $addnbsp=str_pad(" ",$db_olsize)."\n";
     $addfb=str_pad("<?die;?>",$db_olsize)."\n";
     $cutsize=$db_olsize+1;$step=$olnum=0;$onlinetime=$timestamp-$db_onlinetime;
     $fp=fopen($filename,"rb+");
     flock($fp,LOCK_EX);
     fputs($fp,$addfb);
     fseek($fp,0,SEEK_END);
     while(ftell($fp)>$cutsize &&$step<20000){//ftellδٶ filesize ڱ$step
           $step++;
           $offset=-($cutsize*$step);
           fseek($fp,$offset,SEEK_END);
           $line=fread($fp,28);//ȡ28ֽ.Ѿʱ
           if(empty($end)){
                 if(strpos($line,"|")!==false || ftell($fp)<=$cutsize){
                       $end=$offset;//break
                 }
           }
           if(strpos($line,"|")!==false){
                 $detail=explode("|",$line);
                 if($detail[1]<$onlinetime){
                       fseek($fp,$offset,SEEK_END);fputs($fp,$addnbsp);
                 }else{
                       $olnum++;/*Ŀ׼ȷ*/
                 }
           }
     }
     if(isset($end)) ftruncate($fp,filesize($filename)+$end+$cutsize);
     fclose($fp);
     @include 'bbsdata/olcache.php'
     if($filename=="bbsdata/guest.php"){$guestinbbs=$olnum;$userinbbs++;}else{$userinbbs=$olnum;$guestinbbs++;}
     $olcache="<?php\n\$userinbbs=$userinbbs;\n\$guestinbbs=$guestinbbs;\n?>";
     writeover('bbsdata/olcache.php',$olcache);
}

3,ԷƵ޸.ȴƵԼ.Ҽ¼Ϊ޹
ݽṹ˼:¼ͳһĶ.ڿг˴ż¼.ٴÿ¼ĳ.
:
<?die;?>|ؼ####,100,|||||Щ||||||||||*******************
<?die;?>|ؼ####,200,|||||Щ||||||||||*******************
ǵһΪ100ֽڶ.ڶΪ200.Դ
ؼҲö.ͨؼ.
һݽṹԿռ̫.ֻʺϺ̨Ĵ!!!


洢ϲpackunpack ݵļ.:
    /*λַд*/

for ($i=0;$i<strlen($code1);$i++) 
{ 
     $write=array_pop(unpack("c",substr($code1,$i,1)));
     if(strlen($write)==2) $write=?'.$write;
     fwrite($fp, $write,3);
}
fclose($fp);

/*λַȡ*/

$fp=fopen("test1.php","rb");
@flock($fp,LOCK_SH);
$code1=fread($fp,filesize("test1.php")); 
fclose($fp); 
for ($i=0;$i<strlen($code1)/3;$i++) 
{
     $write.=pack("c",substr($code1,$i*3,3));
}
echo $write;

[3]ļ
׼ȷ˵ǰļ󲿷ֵļ.ofstar յûԱõľһ͵ļ
㷨ʵֲõ:˫.ÿݶβö! (require/today.php job.php) 
n--> ݵ޸ֻ 3-5.ϵͳĸ!
˫.ֻҪ3޸.ֱ ͷ.ͷݴ.
޸Ҫ5ݶηֱӵĻϼ.޸ǰһĺ޸ĺһǰ
㷨ʵ:

$offset=filesize($filename);
if($fp=@fopen($filename,"rb+")){
     flock($fp,LOCK_EX);
     list($node,$yestime)=nodeinfo($fp,$dbtdsize,$offset);
     if($node!=''){/*޸ͷ*/
           $nowfp=$offset/($dbtdsize+1);
           if($node!='NULL') {
                 fputin($fp,$node,$dbtdsize,$nowfp);
           }
           if($node!=$nowfp) fputin($fp,$nowfp,$dbtdsize,'node',$node,Y);/**/
     }
     fclose($fp);
}

޸ĵ㷨ʵ:

if($offset=strpos($todaydata,"\n".$ofstarid.'|')){/*ʹþȷƥ "\n".$ofstarid.'|'*/
     $offset+=1;
     if($fp=@fopen($filename,"rb+")){
           flock($fp,LOCK_EX);
           list($node,$yestime)=nodeinfo($fp,$dbtdsize,$offset);/*޸ͷ*/
           $nowfp=$offset/($dbtdsize+1);
           if("$nowfp"!=$node && $node!=''){
                 fputin($fp,$node,$dbtdsize,$nowfp);/*޸ͷָݶ*/
                 list($oldprior,$oldnext)=fputin($fp,$nowfp,$dbtdsize,'node',$node);/*޸Ҫµ*/
                 if($oldprior!='node'){
                       fputin($fp,$oldprior,$dbtdsize,'M',$oldnext);/*޸ǰһĺ*/
                 }
                 if($oldnext!='NULL' && $oldprior!='node'){
                       fputin($fp,$oldnext,$dbtdsize,$oldprior);/*޸ĺһǰ*/
                 }
           }
           fclose($fp);
     }
}

㷨ʵ֣

$filename='bbsdata/today.php'
$dbtdsize=100+1;
$seed=$page*$db_perpage;$count=0;
if($fp=@fopen($filename,"rb")){
     flock($fp,LOCK_SH);
     $node=fread($fp,$dbtdsize);
     $nodedb=explode("|",$node);/*ͷڵڶݶ*/
     $nodefp=$dbtdsize*$nodedb[1];
     fseek($fp,$nodefp,SEEK_SET);
     $todayshow=fseeks($fp,$dbtdsize,$seed);/**/
     fseek($fp,0,SEEK_END);
     $count=floor(ftell($fp)/$dbtdsize)-1;
     fclose($fp);
}

漸㷨Ҫ:

function fputin($fp,$offset,$dbtdsize,$prior='M',$next='M',$ifadd='N')
{
     $offset=$offset*($dbtdsize+1);/*תָƫ*/
     fseek($fp,$offset,SEEK_SET);
     if($ifadd=='N'){
           $iddata=fread($fp,$dbtdsize);
           $idarray=explode("|",$iddata);
           fseek($fp,$offset,SEEK_SET);
     }
     if($next!='M' && $prior!='M'){/*˵һǱĵݶ.ҪϢи*/
           global $ofstarid,$timestamp,$onlineip,$ofstardb;
           $idarray[0]=$ofstarid;$idarray[3]=$ofstardb[8];
           if($ifadd!='N') $idarray[4]=$timestamp;
           $idarray[5]=$timestamp;$idarray[6]=$onlineip;$idarray[7]=$ofstardb[16];$idarray[8]=$ofstardb[17];
     }
     if($prior=='M') $prior=$idarray[1];
     if($next=='M') $next=$idarray[2];
     $data="$idarray[0]|$prior|$next|$idarray[3]|$idarray[4]|$idarray[5]|$idarray[6]|$idarray[7]|$idarray[8]|";
     $data=str_pad($data,$dbtdsize)."\n";/*д*/
     fputs($fp,$data);
     return array($idarray[1],$idarray[2]);/*ݸǰһһ*/
}
function nodeinfo($fp,$dbtdsize,$offset)
{
     $offset=$offset/($dbtdsize+1);
     $node=fread($fp,$dbtdsize);
     $nodedb=explode("|",$node);/*ͷڵڶݶ*/
     if(is_int($offset)){
           $nodedata=str_pad("<?die;?>|$offset|$nodedb[2]|",$dbtdsize)."\n";
           fseek($fp,0,SEEK_SET);/*ָļͷ*/
           fputs($fp,$nodedata);
           return array($nodedb[1],$nodedb[2]);
     }else{
           return ''
     }
}
function fseeks($fp,$dbtdsize,$seed)
{
     $num=0;
     while($break!=1 && $num<$seed){
           $num++;
           $sdata=fread($fp,$dbtdsize);
           $sdb=explode("|",$sdata);
           $sdbnext=$sdb[2]*$dbtdsize;
           if($sdbnext!='NULL'){
                 fseek($fp,$sdbnext,SEEK_SET);
           }else{
                 $break=1;
           }
           $todayshow[]=$sdata;
     }
     return $todayshow;
}

[4]ؼļ
phpʹõҪ˼! ʵļЩʹһ˼.ӵľͲ! ٸ򵥵Ҳǳʵõ! Ҫ˶˼!
Եһ.  ( read.php )

$articlearray=openfile("$dbpath/$fid/$tid.php");
$topic_detail=explode("|",$articlearray[0]);
list($tpc_fb,$tpc_covert,$tpc_author,$rd_icon,$tpc_date,$tpc_title,$tpc_ip,$tpc_sign,$tpc_download,$tpc_rvrc,$tpc_buy,$tpc_ipfrom,$tpc_ifconvert,$tpc_email,$tpc_content,$tpc_null1)=$topic_detail;
list($rd_hit,$rd_islock,$rd_null)=explode(',',$tpc_covert);
$rd_hit=trim($rd_hit);
$rd_hit++;
//$rd_hit=str_pad($rd_hit,8);
$hitwrite="<?die;?>|$rd_hit";
$fp=fopen("$dbpath/$fid/$tid.php","rb+");
flock($fp,LOCK_EX);
fputs($fp,$hitwrite);
fclose($fp);

һ˼ȫtextdbݵĸµĸЧȶ,ӵȴɾ.޸Ķȫȡд,ߵ޸Ƶ.ҲֻҪ޸ӵ()д.

㴦ʲôݶӦ3ݽṹ޸Եɾ޸! 

(2)֤textdbƵݴʱȶ
ڽ textdb ǰ.뿼ݴ.Ͼݵ׼ȷȶһ.ҲֱӸʵֵ㷨.ȡóԱȽϵķʽ!
Ҫ

1) ݵ׼ȷ
ҿϰ˴ͳ̳дĿʼEX,ڴͳtextdb̳ʹõĶд!

function readover($filename,$method="rb")
{
     if($handle=@fopen($filename,$method)){
           flock($handle,LOCK_SH);
           $filedata=fread($handle,filesize($filename));
           fclose($handle);
     }
     return $filedata;
}
function writeover($filename,$data,$method="wb")
{
     $handle=fopen($filename,$method);
     flock($handle,LOCK_EX);
     fputs($handle,$data);
     fclose($handle);
}

СվǸ.ڴվ.ĺòtextdbȶԺݵ׼ȷ!
Ϊͬʱͬһкüʱ.ݵĲ׼ȷԱ. 㷢ʱнд޸Ϣ.Ҫ.ڶ׼дʱ.һ߳Ҳڹǰ¶ȡ.Ҳ׼д.ʱ߳Ƚд.ôд.д벻Ϣ.νӶʧļ! Ȼʹ(һ)еĸصĶĳݽṹ.һļʽΪ0.Ϊȫд!
дʱ֤ݵ׼ȷ㷨
function readlock($filename,$method="rb+")
{
     $file=fopen($filename,$method);
     flock($file,LOCK_EX);
     $filedata=fread($file,filesize($filename));
     rewind($file);
     return array($file,$filedata);
}
function writelock($filename,$data,$handle)
{
     fputs($handle,$data);
     ftruncate($handle,strlen($data));
     fclose($handle);
}

ĺʵֱκγϱ֤ݵ׼ȷ!!!!(ѽݵȶ) ҿԱдϵĿѧ!

2) ݵȶ
ȸԵһ

function readlock($filename,$method="wb")
{
     $file=fopen($filename,$method);
     flock($file,LOCK_EX);
     $filedata=fread($file,filesize($filename));
     return array($file,$filedata);
}
function writelock($filename,$data,$handle)
{
     fputs($handle,$data.$data);
     fclose($handle);
}
function filelock($filename,$method="wb")
{
     $filedb=openfile($filename);
     $handle=fopen($filename,$method);
     flock($handle,LOCK_EX);
     return array($handle,$filedb);
}
$filename='c.php'
list($file,$ofstarfile)=readlock($filename);
$ofstarfile=explode('|',$ofstarfile);
$ofstarfile[4]++;$ofstarfile[5]++;
echo $ofstarfile[4];echo'<br>'
$ofstardb=implode("|",$ofstarfile);
echo $ofstardb;
for($I=0;$I<1500000;$I++)//Ӷ߳ͬʱʱ
{
     $A=$B=2;
}
writelock($filename,$ofstardb,$file);

***********************************
c.php
<?die;?>|42   |1|1|101|101|0|64|1067443200|1067961600|fengyu|fengyu|fengyu||1|2003-10-22 13:33||

ҿԷ unix NTϽв.
Է ͬʱﵽ߳ͬʱͬһ ݶβҵ4.5ݶεֵ˵ȶ.ȶ.עҪ߳ͬʱ4!
Խ:NTռϴ4߳ͬʱĳҵļΪ 50--100%ڲϵͳĶ̷߳.
linux/freebsd д4߳ͬʱֵļΪ0-0.001%Ҳ˵Ϊ 0
Ȼִļʻе! Ҳ֤ʵ! ҪǼʮ߳ͬʱ.phpеϵͳNTĶ̲߳ϵͳµĲ.
Դͳtextdbݲ׼ȷͲȶ--------׽:
ʹµд:

/*дݱ֤ȶ*/
ڸдȶԺǰ.˵һ.
ҿΪٶȸΪ,ֱӰ .php ļֱӵõֵ. ȻһЧ.ڶݴƵļ.мǲʹ include $filename; Ȼݴ writeover(); ˽Ƶݵļùȡ!
ΪȶԵʵַ

function writeover($filename,$data,$method="rb+")
{
     touch($filename);/*ļ򴴽֮.Բfile_exists֤ļ.ԽЧ൱*/
     $handle=fopen($filename,$method);
     flock($handle,LOCK_EX);
     fputs($handle,$data);
     if($method=="rb+") ftruncate($handle,strlen($data));
     fclose($handle);
}
function readlock($filename,$method="rb+")
{
     $file=fopen($filename,$method);
     flock($file,LOCK_EX);
     $filedata=fread($file,filesize($filename));
     rewind($file);
     return array($file,$filedata);
}
function writelock($filename,$data,$handle)
{
     fputs($handle,$data);
     ftruncate($handle,strlen($data));
     fclose($handle);
}

Բ textdb ݴȶ
Ͻݵ׼ȷ.  textdb Ǵݴ!

( ϸ㷨ȶ㷨Ofstar board .ǵͶɹ! )

()textdbЧߵϸ
ʵҪǿˮƽ.վøջǿԸ.潫һofstarڲо phptextdbݴһд㷨һЩɣ
1)ȡipַԴ

function cvipfrom($onlineip)
{
     $detail=explode(".",$onlineip);
     if (file_exists("ipdata/$detail[0].txt"))
           $filename="ipdata/$detail[0].txt";
     else
           $filename="ipdata/0.txt";
     for ($i=0; $i<=3; $i++)
     {
           $detail[$i]   = sprintf("%03d", $detail[$i]);
     }
     $onlineip=join(".",$detail);
     $db=fopen($filename,"rb");
     flock($db,LOCK_SH);
     $onlineipdb=fread($db,filesize($filename));
     if($ofstarset=strpos($onlineipdb,"$detail[0].$detail[1].$detail[2]")){
           $ipfrom=ipselect($db,$ofstarset,$onlineip);
     }elseif($ofstarset=strpos($onlineipdb,"$detail[0].$detail[1]")){
           $ipfrom=ipselect($db,$ofstarset,$onlineip);
     }elseif($ofstarset=strpos($onlineipdb,$detail[0])){
           $ipfrom=ipselect($db,$ofstarset,$onlineip);
     }
     fclose($db);
     if(empty($ipfrom)) $ipfrom='δַ֪'
     return $ipfrom;
}
function ipselect($db,$offset,$onlineip){
     fseek($db,$offset,SEEK_SET);
     $getcontent=fgets($db,100);
     $iparray=explode("|",$getcontent);
     if ($onlineip>=$iparray[0] && $onlineip<=$iparray[1]) return $iparray[2].$iparray[3];
}

㷨ȱȴͳЧʸ3-5.˼.ڴǹʱ.ɲн explode Ҫ֪úܴʱ.ʵԱͨȫȡ.ʹstrpos õؼֵλ! ʹָƫ! ǹؼҪеĿͷ! ȽϷ.ȻڿͷҲ.ֻҪʹ strops Ϳҵλ,ɲοofstar ߻ԱĴ

2)return  global
ں,ʱ
ʹ return ʹ global ҪЧ

function userloginfo($usertemp){
     $detail=explode("|",$usertemp);
     return $detail;
}
$login=userloginfo($userdb);

function userloginfo($usertemp){
     global $detail;
     $detail=explode("|",$usertemp);
}
userloginfo($userdb);
ҪЧ
3)
жϵʱʹif($a==ֵ) 񶨵ʱʹif(empty($a)),Ϊи

4)Сݲʹ file() fget(Чʵ)
㷨:

function openfile($filename,$style='Y')
{
     if($style=='Y'){
           $filedata=readover($filename);
           $filedata=str_replace("\n","\n<:ofstar:>",$filedata);
           $filedb=explode("<:ofstar:>",$filedata);
           //array_pop($filedb);
           $count=count($filedb);
           if($filedb[$count-1]==''||$filedb[$count-1]=="\r"){unset($filedb[$count-1]);}
           if(empty($filedb)){$filedb[0]="";}
           return $filedb;
     }else{
           $filedb=file($filename);
           return $filedb;
     }
}

/*openfileٶȻȶ϶fileϵͳ,openfileǾи.ʱ file ڽݷǳ*/

5)ͬһҳˢ².
if($timestamp-$lastvisit>$db_onlinetime|| ($fid&& $fid!=$HTTP_COOKIE_VARS['lastfid'])||($HTTP_COOKIE_VARS['lastfid']!='' && $star_action=='hm'))
{
     $runfc='Y'
     include "./require/userglobal.php";
}

6)ʱжǷʱ.õ cookie  strops пٲ,˳еЧ
if(!$HTTP_COOKIE_VARS['forum_online'])
{
     $onlinearray=openfile('bbsdata/online.php');
     $count_ol=count($onlinearray);
     for ($i=1; $i<$count_ol; $i++)
     {
           $rd_onlinedb=explode("|",$onlinearray[$i]);
           if($rd_onlinedb[0]!='Ա')
           {
                 if ($timestamp-$rd_onlinedb[1]<=$db_onlinetime )
                       $forum_online.='|'.$rd_onlinedb[0];
           }
     }
           setCookie('forum_online',$forum_online, $cookietime,$ckpath,$ckdomain,$secure);
}
@strpos($forum_online,$tpc_author) !== false ? $read[ifonline]="<img src='$imgpath/$stylepath/read/online.gif' alt='ûĿǰ'>":$read[ifonline]="<img src='$imgpath/$stylepath/read/offonline.gif' alt='ûĿǰ'>";


()ݵļ
βԲ жȡid.ʹ fopen ļ. Fread õ.ٲfgets ȡ. ˼ٶ.ڳЧѾ֤ ʹ file()ٶ. ofstar ļﲻ file()ȡ,ʵ֤ʹһ textdb cpu ڴü!

()textdbȫά
.RDBMStextdb ȫǣ浽3!ͽ˵textdbȫķ: ݽӿڰȫ.빥,İȫ

1) ݽӿڰȫ
ļֱӱڿռϵ.Աļüܻضķ.ķ.ʹضĿ¼.Ŀ¼ΪݴŵĿ¼! һȫԿԱ֤.һĿ¼֪.Ĵ. ofstar ļ .php ִļβ.ļڵһ  <?die?> ķ!! ׽textdb ļİȫ.! 

2) 빥
ֱӽ ofstar˼:ڱֹ֤ͨͬʱ,ȫֹԶύİȫ,ȫжϸܴڵĶ!ԶζԱĶ

3) İȫ
ֻlinux/unix ûĲϵͳ.ó򴴽ݺûĿ¼ӶҪֶá777Զļ.ȷ㰲װֽunix/ linuxϵͳtextdbݵİȫ⡣

. Ofstarһδνǿ.ǵѡ!
°汾Ŀ.ǻ̳ĸءȶԺٶȵǿ.ǿİȫ.ڹܺϴ̨....